home *** CD-ROM | disk | FTP | other *** search
- Path: news.cc.sunysb.edu!usenet
- From: dkat@psych1.psy.sunysb.edu (DK)
- Newsgroups: comp.lang.c
- Subject: Re: help rand !
- Date: Fri, 19 Apr 1996 19:44:43 GMT
- Organization: State University of New York at Stony Brook
- Message-ID: <4l8f4d$i2s@abel.cc.sunysb.edu>
- References: <4l5d75$mes@usenetp1.news.prodigy.com> <4l5fj4$1ehs@serra.unipi.it> <4l5vjm$5lj@ccshst05.uoguelph.ca> <4l7bnt$r44@griffin.itc.gu.edu.au>
- NNTP-Posting-Host: catsam.psy.sunysb.edu
- X-Newsreader: Forte Free Agent 1.0.82
-
-
- >swap n[1] with n[rand]
- >swap n[2] with n[rand]
- >......................
- >swap n[10] with n[rand]
- /* don't forget to mod rand() (n[(rand()%12)]) so you don't overwrite
- your buffer - or >> shift and mask - DK*/
- >after: n[1] = 9
- > n[2] = 3
- > : :
- > n[10]= 6
-
- >This ain't that great, but it will work predictably.
-
-
-